﻿#region

using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using JsMapper.ExampleImplementation.Models;

#endregion

namespace JsMapper.ExampleImplementation.ApiControllers
{
    public class EmployeeController : ApiController
    {
        private static readonly List<Employee> Repo = new List<Employee>
            {
                new Employee
                    {
                        Id = 1,
                        Name = "John"
                    },
                new Employee
                    {
                        Id = 2,
                        Name = "Jane",
                        Salutation = "Mrs."
                    }
            };

        // GET api/employee
        public IEnumerable<Employee> Get()
        {
            return Repo;
        }

        // GET api/employee/5
        public Employee Get(int id)
        {
            return Repo.FirstOrDefault(x => x.Id == id);
        }

        // POST api/employee
        public void Post(Employee value)
        {
        }

        // PUT api/employee/5
        public void Put(int id, Employee value)
        {
        }

        // DELETE api/employee/5
        public void Delete(int id)
        {
        }
    }
}